package com.jwdf.uda.ui.fragment.question.index;
import android.annotation.SuppressLint;
import android.databinding.DataBindingUtil;
import android.view.View;

import com.jwdf.uda.bean.PbBean;
import com.jwdf.uda.databinding.ViewNetErrorBinding;
import com.jwdf.uda.event.QuizNetErrorEvent;

/**
 * Created by fatsfan on 2016/9/8.
 */
@SuppressLint("ValidFragment")
public class QuizNewFragment extends QuizIndexFragment {

    public QuizNewFragment() {
        restType = PbBean.PbSignBaseQuestionType.QUESTION_INDEX_NEW;
        setTitle("最新");
    }

    public void onEventMainThread(QuizNetErrorEvent event) {
        ViewNetErrorBinding errorBinding = DataBindingUtil.bind(mErrorView);
        errorBinding.failedLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                requestData(true);
            }
        });
        if (errorBinding.getRoot().getParent() == null) {
            mDataBinding.quizContainer.addView(errorBinding.getRoot());
        }
    }


}
